/*
 * @Description: Teacher
 * @Author: rendc
 * @Date: 2024-09-10 10:26:24
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-10 11:18:48
 */
public class Teacher{
  // 成员变量
  // 姓名
  private String name;
  // 性别
  private char gender;
  // 工号
  private String id;
  // get 方法
  public String getName(){
    return name;
  }
  public char getGender(){
    return gender;
  }
  public String getId(){
    return id;
  }
  // set方法
  public void setName(String name){
    System.out.println("name="+name);
    this.name = name;
  }
  public void setGender(char gender){
    System.out.println("gender="+gender);
    this.gender = gender;
  }
  public void setId(String id){
    System.out.println("id="+id);
    this.id = id;
  }
  // 构造器 无参构造器
  public Teacher(){
    System.out.println("无参构造器");
  }
  // 构造器 两个参数构造器
  public Teacher(String name,String id){
    System.out.println("两个参数构造器");
    this.name = name;
    this.id = id;
  }
  // 构造器 三个参数构造器
  public Teacher(String name,String id,char gender){
    this(name,id);
    System.out.println("三个参数构造器");
    // this.name = name;
    // this.id = id;
    this.gender = gender;
  }
  // sayHello
  public void sayHello(){
    System.out.println("老师的姓名是："+name+"，性别是"+gender+"，工号是："+id);
  }
}